const { defineConfig } = require("@vue/cli-service");
const { VantResolver } = require("unplugin-vue-components/resolvers");
const ComponentsPlugin = require("unplugin-vue-components/webpack");
const path = require("path");
module.exports = defineConfig({
  transpileDependencies: true,
  // publicPath: "./",
  configureWebpack: {
    devServer: {
      // port: 8080, // 服务器端口
      proxy: {
        "/xuantong": {
          target: "https://static.xuantong.cn",
          changeOrigin: true,
          pathRewrite: {
            "^/xuantong": "",
          },
        },
        "/apixt": {
          target: "https://api.xuantong.cn",
          changeOrigin: true,
          pathRewrite: {
            "^/apixt": "",
          },
        },
      },
    },

    // vant配置
    plugins: [
      ComponentsPlugin({
        resolvers: [VantResolver()],
      }),
    ],
    // 配置路径别名
    resolve: {
      alias: {
        "@/assets": path.resolve(__dirname, "src/assets"),
        "@/utils": path.resolve(__dirname, "src/utils"),
      },
    },
  },
});

// vant 配置
